package ad.events 
{
	import flash.events.Event;
	
	/**
	 * MediaEvent
	 * @version ActionScript 3.0
	 * @author Adrian C. Miranda
	 * @mail ad@adrianmiranda.com.br
	 */
	public class MediaEvent extends Event 
	{
		public static const SECURITY_ERROR:String = 'MediaEvent.SECURITY_ERROR';
		public static const IO_ERROR:String = 'MediaEvent.IO_ERROR';
		
		public static const ID3:String = 'MediaEvent.ID3';
		
		public static const OPEN:String = 'MediaEvent.OPEN';
		public static const PROGRESS:String = 'MediaEvent.PROGRESS';
		public static const COMPLETE:String = 'MediaEvent.COMPLETE';
		public static const MEDIA_COMPLETE:String = 'MediaEvent.MEDIA_COMPLETE';
		
		public var media:Event;
		
		public function MediaEvent(type:String, media:Event = null, bubbles:Boolean = false, cancelable:Boolean = false) 
		{ 
			super(type, bubbles, cancelable);
			this.media = media;
		} 
		
		public override function clone():Event 
		{ 
			return new MediaEvent(type, media, bubbles, cancelable);
		} 
		
		public override function toString():String 
		{ 
			return formatToString('MediaEvent', 'type', 'media', 'bubbles', 'cancelable', 'eventPhase'); 
		}
		
	}
	
}